package scenic.filter;

/**
 * Box filter kernel.
 */
public class BoxKernel extends SeparableKernel {
	private static BoxKernel kernel;
	
	private BoxKernel() {
	}
	
	public double getValue(double x) {
		if(x < -0.5 || x > 0.5)
			return 0.0;
		return 1.0;
	}
	
	public static BoxKernel getKernel() {
		if(kernel == null)
			kernel = new BoxKernel();
		return kernel;
	}
}
